// 基于template/src/views/{{appModules}}/{{pages@DEDATAVIEW}}/{{spinalCase page.codeName}}-model.ts.hbs生成
import { IDataViewModel } from "@/core/interface/view/model";

//  获取视图模型
function getModel(): IDataViewModel {
    return {
        caption: "实体数据视图（内置功能）",
        title: "实体数据视图（内置功能）",
        capPSLanguageRes: "MENUITEM.CAPTION.ENTITYDATAVIEW",
        titlePSLanguageRes: "PAGE.TITLE.IBIZBOOK.DATAVIEW",
        showDataInfoBar: false,
        codeName: 'IBIZBOOKDataView',
        uiEngineModel: [
                    {
                        name: 'toolbar_deuiaction1_click',
                        triggerType: 'CTRLEVENT',
                        logicType: 'APPVIEWUIACTION',
                        eventNames: 'CLICK',
                        scriptCode: ``,
                        logicName:``,
                        logicTag: '',
                        eventArg: 'deuiaction1',
                        eventArg2: '',
                        timer: 0,
                        psViewCtrlName: 'toolbar',
                        uIActionTag: 'New',
                        entityCodeName: '',
                    },
                    {
                        name: 'toolbar_deuiaction2_click',
                        triggerType: 'CTRLEVENT',
                        logicType: 'APPVIEWUIACTION',
                        eventNames: 'CLICK',
                        scriptCode: ``,
                        logicName:``,
                        logicTag: '',
                        eventArg: 'deuiaction2',
                        eventArg2: '',
                        timer: 0,
                        psViewCtrlName: 'toolbar',
                        uIActionTag: 'Remove',
                        entityCodeName: '',
                    },
                    {
                        name: 'toolbar_deuiaction3_click',
                        triggerType: 'CTRLEVENT',
                        logicType: 'APPVIEWUIACTION',
                        eventNames: 'CLICK',
                        scriptCode: ``,
                        logicName:``,
                        logicTag: '',
                        eventArg: 'deuiaction3',
                        eventArg2: '',
                        timer: 0,
                        psViewCtrlName: 'toolbar',
                        uIActionTag: 'ToggleFilter',
                        entityCodeName: '',
                    },
                    {
                        name: 'newdata',
                        triggerType: 'CUSTOM',
                        logicType: 'SYSUILOGIC',
                        eventNames: '',
                        scriptCode: ``,
                        logicName:``,
                        logicTag: '',
                        eventArg: '',
                        eventArg2: '',
                        timer: 0,
                        psViewCtrlName: '',
                        entityCodeName: '',
                    },
                    {
                        name: 'opendata',
                        triggerType: 'CUSTOM',
                        logicType: 'SYSUILOGIC',
                        eventNames: '',
                        scriptCode: ``,
                        logicName:``,
                        logicTag: '',
                        eventArg: '',
                        eventArg2: '',
                        timer: 0,
                        psViewCtrlName: '',
                        entityCodeName: '',
                    }
            ],
        ctrls: [
            {
                name: 'quicksearchform',
                codeName: 'QUICKSEARCHFORM',
                controlType: 'SEARCHFORM',
            },
            {
                name: 'searchform',
                codeName: 'Default',
                controlType: 'SEARCHFORM',
            },
            {
                name: 'toolbar',
                codeName: 'DataViewtoolbar',
                controlType: 'TOOLBAR',
            },
            {
                name: 'dataview',
                codeName: 'Usr',
                controlType: 'DATAVIEW',
            }
        ],
        ctrlParams: {
            IBIZBOOKquicksearchform: {},
            IBIZBOOKsearchform: {},
            IBIZBOOKtoolbar: {},
            IBIZBOOKdataview: {},
        },
        cssName: "",
        name: "IBIZBOOKDataView",
        viewType: "DEDATAVIEW",
        viewStyle: "DEFAULT",
        showCaption: false,
        isLoadDefault: true,
        entityCodeName: "IBIZBOOK",
        keyPSAppDEField: "IBIZBOOKId",
        majorPSAppDEField: "IBIZBOOKName",
        enableQuickSearch: true,
        expandSearchForm:false,
        enableQuickGroup: true,
        quickGroupCodeList: "Sample__Bookgroup",
        newData: {
            deCodeName: 'IBIZBOOK',
            newDataViewName: 'IBIZBOOKEditView',
        },
        openData: {
            deCodeName: 'IBIZBOOK',
            openDataViewName: 'IBIZBOOKEditView',
        },
        toolbarItems: [
            {
          		actionLevel: '100',
          		caption: '新建',
          		captionLanResTag: 'TBB.TEXT.*.NEW',
          		name: 'deuiaction1',
          		showCaption: true,
          		tooltip: '新建',
          		tooltipLanResTag: 'TBB.TOOLTIP.*.NEW',
          		itemType: 'DEUIACTION',
          		showIcon: true,
          		disabled: false,
          		cssName: '',
          		imagePath: '',
          		iconCls: 'fa fa-file-text-o',
                  imagePathX: '',
          		dataAccessAction: '',
          		noPrivDisplayMode: 2,
          		uiAction: {
          			codeName: 'New',
          			uIActionMode: 'SYS',
          			actionTarget: '',
          			uIActionTag: 'New',
          			uIActionType: 'DEUIACTION'
          		},
                  logic: {
                  	name: 'toolbar_deuiaction1_click',
                  	actionTag: 'New',
                  	xDataCtrlName: 'dataview',
                  	predefinedType: 'EDITVIEW_NEWACTION',
                  }
            },
            {
          		actionLevel: '100',
          		caption: '删除',
          		captionLanResTag: 'TBB.TEXT.*.REMOVE',
          		name: 'deuiaction2',
          		showCaption: true,
          		tooltip: '删除',
          		tooltipLanResTag: 'TBB.TOOLTIP.*.REMOVE',
          		itemType: 'DEUIACTION',
          		showIcon: true,
          		disabled: false,
          		cssName: '',
          		imagePath: '',
          		iconCls: 'fa fa-remove',
                  imagePathX: '',
          		dataAccessAction: '',
          		noPrivDisplayMode: 2,
          		uiAction: {
          			codeName: 'Remove',
          			uIActionMode: 'SYS',
          			actionTarget: 'MULTIKEY',
          			uIActionTag: 'Remove',
          			uIActionType: 'DEUIACTION'
          		},
                  logic: {
                  	name: 'toolbar_deuiaction2_click',
                  	actionTag: 'Remove',
                  	xDataCtrlName: 'dataview',
                  	predefinedType: 'GRIDVIEW_REMOVEACTION',
                  }
            },
            {
          		actionLevel: '100',
          		caption: '过滤',
          		captionLanResTag: 'TBB.TEXT.*.FILTER',
          		name: 'deuiaction3',
          		showCaption: true,
          		tooltip: '过滤',
          		tooltipLanResTag: 'TBB.TOOLTIP.*.FILTER',
          		itemType: 'DEUIACTION',
          		showIcon: true,
          		disabled: false,
          		cssName: '',
          		imagePath: '',
          		iconCls: 'fa fa-filter',
                  imagePathX: '',
          		dataAccessAction: '',
          		noPrivDisplayMode: 2,
          		uiAction: {
          			codeName: 'ToggleFilter',
          			uIActionMode: 'SYS',
          			actionTarget: '',
          			uIActionTag: 'ToggleFilter',
          			uIActionType: 'DEUIACTION'
          		},
                  logic: {
                  	name: 'toolbar_deuiaction3_click',
                  	actionTag: 'ToggleFilter',
                  	xDataCtrlName: 'dataview',
                  	predefinedType: 'GRIDVIEW_SEARCHBAR',
                  }
            },
        ],
        toolbarLogics: [
            ]     ,
        xDataCtrlName: "dataview",
        quickSearchPlaceholder: ['图书名称',].join(","),
        useDefaultLayout: true,
        rowActiveMode: 2,
    }
};

//  获取工具栏
function getToolbarItems() {
  return [
    {
  		actionLevel: '100',
  		caption: '新建',
  		captionLanResTag: 'TBB.TEXT.*.NEW',
  		name: 'deuiaction1',
  		showCaption: true,
  		tooltip: '新建',
  		tooltipLanResTag: 'TBB.TOOLTIP.*.NEW',
  		itemType: 'DEUIACTION',
  		showIcon: true,
  		disabled: false,
  		cssName: '',
  		imagePath: '',
  		iconCls: 'fa fa-file-text-o',
          imagePathX: '',
  		dataAccessAction: '',
  		noPrivDisplayMode: 2,
  		uiAction: {
  			codeName: 'New',
  			uIActionMode: 'SYS',
  			actionTarget: '',
  			uIActionTag: 'New',
  			uIActionType: 'DEUIACTION'
  		},
          logic: {
          	name: 'toolbar_deuiaction1_click',
          	actionTag: 'New',
          	xDataCtrlName: 'dataview',
          	predefinedType: 'EDITVIEW_NEWACTION',
          }
    },
    {
  		actionLevel: '100',
  		caption: '删除',
  		captionLanResTag: 'TBB.TEXT.*.REMOVE',
  		name: 'deuiaction2',
  		showCaption: true,
  		tooltip: '删除',
  		tooltipLanResTag: 'TBB.TOOLTIP.*.REMOVE',
  		itemType: 'DEUIACTION',
  		showIcon: true,
  		disabled: false,
  		cssName: '',
  		imagePath: '',
  		iconCls: 'fa fa-remove',
          imagePathX: '',
  		dataAccessAction: '',
  		noPrivDisplayMode: 2,
  		uiAction: {
  			codeName: 'Remove',
  			uIActionMode: 'SYS',
  			actionTarget: 'MULTIKEY',
  			uIActionTag: 'Remove',
  			uIActionType: 'DEUIACTION'
  		},
          logic: {
          	name: 'toolbar_deuiaction2_click',
          	actionTag: 'Remove',
          	xDataCtrlName: 'dataview',
          	predefinedType: 'GRIDVIEW_REMOVEACTION',
          }
    },
    {
  		actionLevel: '100',
  		caption: '过滤',
  		captionLanResTag: 'TBB.TEXT.*.FILTER',
  		name: 'deuiaction3',
  		showCaption: true,
  		tooltip: '过滤',
  		tooltipLanResTag: 'TBB.TOOLTIP.*.FILTER',
  		itemType: 'DEUIACTION',
  		showIcon: true,
  		disabled: false,
  		cssName: '',
  		imagePath: '',
  		iconCls: 'fa fa-filter',
          imagePathX: '',
  		dataAccessAction: '',
  		noPrivDisplayMode: 2,
  		uiAction: {
  			codeName: 'ToggleFilter',
  			uIActionMode: 'SYS',
  			actionTarget: '',
  			uIActionTag: 'ToggleFilter',
  			uIActionType: 'DEUIACTION'
  		},
          logic: {
          	name: 'toolbar_deuiaction3_click',
          	actionTag: 'ToggleFilter',
          	xDataCtrlName: 'dataview',
          	predefinedType: 'GRIDVIEW_SEARCHBAR',
          }
    },
  ]
}

export const model = getModel();
export const toolbarItems = getToolbarItems();